<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.4.1.min.js" type="text/javascript"></script>
    <script src="js/home.js" type="text/javascript"></script>
    <style>
        table, tr, td, thead {
            border: 1px solid blue;
            border-collapse: collapse;
        }
    </style>
<body>
<script>

    $(function () {
        let data = [{val: "1", "text": "选题提"}, {val: "2", "text": "判断题"}];
        for (let i = 0; i < data.length; i++) {
            //设置赋值
            $("#bb").append("<option value='" + data[i].val + "'>" + data[i].text + "</option>")
        }

    })

    function aa() {
        let a = $('#bb option:selected').text();//拿值
        console.log(a);
        if (a == "选择题") {
            $("#xuanzeti").show();

            $("#panduan").hide();
        }
        if (a == "判断题") {
            // if(bb.val()=="3"){
            $("#panduan").show();

            $("#xuanzeti").hide();
        }
    }
</script>
<select onchange="aa()" id="bb" onselect="aa()">
    <option value="1">选择题</option>
    <option value="2">多选题</option>
    <option value="3">判断题</option>
</select>
<!--选择题-->
<div id="xuanzeti" style="display: none">
    <div>
        试题名称：<input type="text" value="引用类型有哪些？">
    </div>
    <div>
        A：<input type="text" value="String">
    </div>
    <div>
        B：<input type="text" value="String">
    </div>
    <div>
        C：<input type="text" value="String">
    </div>
    <div>
        D：<input type="text" value="String">
    </div>
</div>
<div id="panduan" style="display: none">
    <div>
        试题名称：<input type="text" value="1+1=2？">
    </div>
    <div>
        <input type="radio">✔
    </div>
    <div>
        <input type="radio">✖
    </div>
</div>
<div>
    ID：<input type="text" id="id">
</div>
<div>
    用户名：<input type="text" id="username">
</div>
<div>
    密码：<input type="password" id="password">
</div>
<div>
    角色选择
    <select id="selectRole">
    </select>
</div>
<div>
    <input type="button" id="btn" value="获取所有试卷">
    <input type="button" id="btn2" value="获取试卷题目">
    <input type="button" id="mark" value="分数">
</div>
<div id="xianshi"></div>
</body>
</html>